Optimal. Leaf size=69 \[ -a x \left (a^2-3 b^2\right )+\frac{3 a^2 b \log (\sin (c+d x))}{d}-\frac{a^2 \cot (c+d x) (a+b \tan (c+d x))}{d}-\frac{b^3 \log (\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0874544, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3565, 3624, 3475} \[ -a x \left (a^2-3 b^2\right )+\frac{3 a^2 b \log (\sin (c+d x))}{d}-\frac{a^2 \cot (c+d x) (a+b \tan (c+d x))}{d}-\frac{b^3 \log (\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3565
Rule 3624
Rule 3475
Rubi steps
\begin{align*} \int \cot ^2(c+d x) (a+b \tan (c+d x))^3 \, dx &=-\frac{a^2 \cot (c+d x) (a+b \tan (c+d x))}{d}+\int \cot (c+d x) \left (3 a^2 b-a \left (a^2-3 b^2\right ) \tan (c+d x)+b^3 \tan ^2(c+d x)\right ) \, dx\\ &=-a \left (a^2-3 b^2\right ) x-\frac{a^2 \cot (c+d x) (a+b \tan (c+d x))}{d}+\left (3 a^2 b\right ) \int \cot (c+d x) \, dx+b^3 \int \tan (c+d x) \, dx\\ &=-a \left (a^2-3 b^2\right ) x-\frac{b^3 \log (\cos (c+d x))}{d}+\frac{3 a^2 b \log (\sin (c+d x))}{d}-\frac{a^2 \cot (c+d x) (a+b \tan (c+d x))}{d}\\ \end{align*}
Mathematica [C] time = 0.136075, size = 80, normalized size = 1.16 \[ -\frac{a^3 \cot (c+d x)-\frac{1}{2} (b+i a)^3 \log (-\cot (c+d x)+i)+\frac{1}{2} (-b+i a)^3 \log (\cot (c+d x)+i)-b^3 \log (\tan (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 79, normalized size = 1.1 \begin{align*} -{a}^{3}x+3\,a{b}^{2}x-{\frac{{a}^{3}\cot \left ( dx+c \right ) }{d}}+3\,{\frac{b{a}^{2}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-{\frac{{b}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{{a}^{3}c}{d}}+3\,{\frac{a{b}^{2}c}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.49508, size = 100, normalized size = 1.45 \begin{align*} \frac{6 \, a^{2} b \log \left (\tan \left (d x + c\right )\right ) - 2 \,{\left (a^{3} - 3 \, a b^{2}\right )}{\left (d x + c\right )} -{\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac{2 \, a^{3}}{\tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.67587, size = 240, normalized size = 3.48 \begin{align*} \frac{3 \, a^{2} b \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) - b^{3} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) - 2 \,{\left (a^{3} - 3 \, a b^{2}\right )} d x \tan \left (d x + c\right ) - 2 \, a^{3}}{2 \, d \tan \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.89713, size = 114, normalized size = 1.65 \begin{align*} \begin{cases} \tilde{\infty } a^{3} x & \text{for}\: \left (c = 0 \vee c = - d x\right ) \wedge \left (c = - d x \vee d = 0\right ) \\x \left (a + b \tan{\left (c \right )}\right )^{3} \cot ^{2}{\left (c \right )} & \text{for}\: d = 0 \\- a^{3} x - \frac{a^{3}}{d \tan{\left (c + d x \right )}} - \frac{3 a^{2} b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{3 a^{2} b \log{\left (\tan{\left (c + d x \right )} \right )}}{d} + 3 a b^{2} x + \frac{b^{3} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 2.03087, size = 119, normalized size = 1.72 \begin{align*} \frac{6 \, a^{2} b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) - 2 \,{\left (a^{3} - 3 \, a b^{2}\right )}{\left (d x + c\right )} -{\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac{2 \,{\left (3 \, a^{2} b \tan \left (d x + c\right ) + a^{3}\right )}}{\tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]